﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using AsterNET.FastAGI.Command;

namespace AsterNET.Extensions.FastAGI.Helpers
{
    public class AGIHelper
    {
        /// <summary>
        /// Executes an Asterisk Gateway Interface compliant program on a channel. 
        /// AGI allows Asterisk to launch external programs written in any language to
        /// control a telephony channel, play audio, read DTMF digits, etc. by communicating 
        /// with the AGI protocol on stdin and stdout.
        /// </summary>
        /// <param name="agi"></param>
        /// <param name="arguments"></param>
        /// <returns></returns>
        public static ExecCommand AGI(string agi, params string[] arguments)
        {
            var rtn = String.Join(",", arguments);
            return new ExecCommand("AGI", rtn);
        }
    }
}
